<div id="main-content">
  <div class="container-fluid">
    <div class="row-fluid">
			<div class="span12">
				<div class="widget-block">
					<div class="widget-head">
						<h5><?php print $title?></h5>
            <div class="widget-control pull-right">
              <a href="#" data-toggle="dropdown" class="btn dropdown-toggle"><i class="icon-cog"></i><b class="caret"></b></a>
              <ul class="dropdown-menu">
                <li><a href="<?php print   site_url("keuangan-mahasiswa/export-btn-format/") ?>"><i class="icon-plus"></i>Export BTN Format</a></li>
                <li><a href="<?php print   site_url("keuangan-mahasiswa/import-btn-format/") ?>"><i class="icon-plus"></i>Import BTN</a></li>
              </ul>
            </div>
					</div>
					<div class="widget-content">
            <div class="widget-searchbox">
              <ul>
                <li class="row-counts">Total Post: <span id='total_row_quotation'><?php print $total?></span></li>
              </ul>
              <?php print $this->form_eksternal->form_open()?>
              <ul>
                <li class="row-counts">
                  <div class="input-prepend"> <span class="add-on">Nama / NIM</span>
                    <input name="cari_name_nim" type="text" id="cari" class="span2" value="<?php print $this->session->userdata("keuangan_mahasiswa_cari_mahasiswa")?>">
                  </div>
                </li>
                <li class="row-counts">
                  <div class="input-prepend"> <span class="add-on">Prodi-Program Kuliah</span>
                    <?php print $this->form_eksternal->form_dropdown("cari_course_category", $course_category, array($this->session->userdata("keuangan_mahasiswa_cari_course_category")));?>
                  </div>
                </li>
                <li class="row-counts">
                  <div class="input-prepend"> <span class="add-on">Angkatan</span>
                    <?php print $this->form_eksternal->form_dropdown("cari_kelompok", $kelompok, array($this->session->userdata("keuangan_mahasiswa_cari_kelompok")));?>
                  </div>
                </li>
                <li class="row-counts">
                  <div class="input-prepend"> <span class="add-on">Status</span>
                    <?php print $this->form_eksternal->form_dropdown("cari_status", $status_mahasiswa, array($this->session->userdata("keuangan_mahasiswa_cari_status")));?>
                  </div>
                </li>
              </ul>
              <ul>
                <li class="row-counts">
                  <button type="submit" name="cari" value="cari" class="btn btn-small">Search</button>
                  <button type="submit" name="cari" value="clear" class="btn btn-small">Clear</button>
                </li>
              </ul>
              </form>
              <br />
            </div>
            <div class="widget-box">
              <table id="inti-quotation" class="table table-striped">
                <thead>
                  <tr>
                    <th><?php print lang("zikula_nim")?></th>
                    <th><?php print lang("name")?></th>
                    <th><?php print lang("keuangan_mahasiswa_kelompok")?></th>
                    <th><?php print lang("keuangan_mahasiswa_status_mahasiswa")?></th>
                    <th><?php print lang("keuangan_mahasiswa_beban")?></th>
                    <th><?php print lang("keuangan_mahasiswa_dibayar")?></th>
                    <th><?php print lang("keuangan_mahasiswa_diambil")?></th>
                    <th><?php print lang("keuangan_mahasiswa_balance")?></th>
                    <th><?php print lang("action")?></th>
                  </tr>
                </thead>
                <tbody id="ajax-body-quotation">
                </tbody>
              </table>
              <input type="text" value="create_date" id="field_simpan" style="display: none" />
              <input type="text" value="desc" id="sort_simpan" style="display: none" />
            </div>
          </div>
				</div>
			</div>
		</div>
  </div>
</div>

<script>
  function add_row_tambahan(table,url,act,param){
    var no = parseInt($('#'+param).val());
    $('#'+param).val(no+1);
    $.post(url,{no:$('#'+param).val(),action:act},function(data){
        $(data).clone(true).insertBefore("#"+table+" #"+act);
    });
  }
  function del_row_class(tr){
    $("."+tr).remove();
  }
  
  
  $(document).ready( function () {
    
    
    del_row_class('ajax-quotation');
    add_row_tambahan('inti-quotation','<?php print site_url("keuangan-mahasiswa/ajax-mahasiswa")?>/'+$('#total_row_quotation').text(),'ajax-body-quotation');
    $("th").removeClass();
    $("th").addClass("sorting");
    $("#create_date").removeClass("sorting");
    $("#create_date").addClass("sorting_desc");
  });
  function load_quotation(id){
    if(id == undefined){
      id = 0;
    }
    del_row_class('ajax-quotation');
    add_row_tambahan('inti-quotation','<?php print   site_url("keuangan-mahasiswa/ajax-mahasiswa")?>/'+$('#total_row_quotation').text()+'/'+id,'ajax-body-quotation');
    return false;
  }
  
</script>